﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/Admin.master" AutoEventWireup="true" CodeFile="Roles.aspx.cs" Inherits="Administration_Roles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">

    <div class="menu-box-header">
     <ul class="content-box-tabs">
        <li><asp:LinkButton runat="server" ID="t1" OnCommand="Action" CommandName="tab1" Text="<%$ Resources:stringsRes, adm_Roles%>" CssClass="default-tab" /></li>
        <li><asp:LinkButton runat="server" ID="t2" OnCommand="Action" CommandName="tab2" Text="<%$ Resources:stringsRes, adm_RolesCreate%>" /></li>
        <li><asp:LinkButton runat="server" ID="t3" OnCommand="Action" CommandName="tab3" Text="<%$ Resources:stringsRes, adm_RolesUserRoles%>" /></li>
    </ul>
    </div>
    <div class="clear"></div><br />
 
    <asp:MultiView runat="server" ID="multiview" ActiveViewIndex="0">
    
        <asp:View runat="server" ID="view1">
            
             <h3><img src="Resources/Images/Icons/users_two_48.png" /> <asp:Localize runat="server" ID="loc1" Text="<%$ Resources:stringsRes, adm_Current_Roles%>" /></h3>
            
                <asp:GridView runat="server" ID="gwRoles" CssClass="admTable" AutoGenerateColumns="false" OnRowCommand="Action">
                   <Columns>
                    <asp:TemplateField HeaderText="Role" HeaderStyle-Font-Bold="true">
                    <ItemTemplate>
                      <%#Container.DataItem.ToString() %>
                    </ItemTemplate>
                  </asp:TemplateField>     
                   
                   <asp:TemplateField HeaderText="Edit role">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lnkEdit" CssClass="btnEdit" CommandArgument="<%#Container.DataItem.ToString()%>" CommandName="edit_role"></asp:LinkButton>
                    </ItemTemplate>
                  </asp:TemplateField>
                  
                  <asp:TemplateField HeaderText="Delete role">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" OnClientClick="return confirm('Do you want to delete this role?'); return false;" ID="lnkDel" CssClass="btnDelete" CommandArgument="<%#Container.DataItem.ToString()%>" CommandName="delete_role"></asp:LinkButton>
                    </ItemTemplate>
                  </asp:TemplateField>
                       
                 
                  </Columns>
                </asp:GridView>
      
        </asp:View>
        
        
        <asp:View runat="server" ID="view2">
           
            <h3><asp:Localize runat="server" ID="Localize1" Text="<%$ Resources:stringsRes, adm_Current_RolesAddEdit%>" /></h3>
            <p><label><asp:Localize runat="server" ID="Localize2" Text="<%$ Resources:stringsRes, adm_Roles_RoleName%>" /></label><asp:TextBox runat="server" CssClass="text-input small-input" ID="txtRole"/></p>
            <%--
            <br />
            <b>Assaign rights to Role</b><br />
            <asp:ListBox runat="server" ID="listRight" Width="200" SelectionMode="Multiple" Height="300">
                <asp:ListItem Text="Edit Section" Value="1"></asp:ListItem>
                <asp:ListItem Text="Delete section"></asp:ListItem>
                <asp:ListItem Text="Set a section offline"></asp:ListItem>
                <asp:ListItem Text="Upload images and files"></asp:ListItem>
            </asp:ListBox>
              --%>
            <asp:LinkButton runat="server" CssClass="button" ID="btnCreate" OnCommand="Action" CommandName="create_role" Text="<%$ Resources:stringsRes, glb__Save%>" />
         
        
        </asp:View>
        
        <asp:View runat="server" ID="view3">
        <h3><asp:Localize runat="server" ID="Localize3" Text="<%$ Resources:stringsRes, adm_Roles_UserRoles%>" /></h3>
        <p><asp:Localize runat="server" ID="Localize4" Text="<%$ Resources:stringsRes, adm_Roles_UserRolesDescription%>" /></p>
        <table border="0" style="width: 410px;" cellpadding="3" cellspacing="3">
            <tr>
                <td>
                    <b><asp:Localize runat="server" ID="Localize6" Text="<%$ Resources:stringsRes, adm_Users%>" /></b><br />
                    <asp:ListBox runat="server" AutoPostBack="true" ID="lstUsers" Width="200" Height="300" OnSelectedIndexChanged="UpdateRoles"></asp:ListBox>
                </td>
                <td>
                    <b><asp:Localize runat="server" ID="Localize5" Text="<%$ Resources:stringsRes, adm_Roles%>" /></b><br />
                    <asp:ListBox runat="server" ID="lstRoles" Width="200" SelectionMode="Multiple" Height="300"></asp:ListBox>
                </td>
           
                
            </tr>
            <tr>
                <td colspan="2" align="right"><asp:Button CssClass="button" runat="server" ID="btnSetRoles" Text="<%$ Resources:stringsRes, adm_Roles_UpdateRoles%>" OnClick="UpdateUserRoles" /></td>
            </tr>
        </table>
        </asp:View>
    
    </asp:MultiView>
     


</asp:Content>

